class CreateCallForWorkers < ActiveRecord::Migration
  def self.up
    create_table :call_for_workers do |t|
      t.text :message
      t.timestamps
    end
    
    create_table :call_for_workers_events, :id => false do |t|
      t.integer :event_id
      t.integer :call_for_worker_id
    end
    
    add_index :call_for_workers_events, [:event_id, :call_for_worker_id], :name => 'idx_cfw_event'
  end

  def self.down
    drop_table :call_for_workers_events
    drop_table :call_for_workers
  end
end
